package main.java.indi.zyj.sword;

public class TakeAttendance {

    public int takeAttendance(int[] records) {

        int[] array = new int[records.length];

        for (int i = 0; i < records.length; i++) {
            array[records[i]] = 1;
        }

        for (int i = 0; i < records.length; i++) {
            if (array[i] != 1) {
                return i;
            }
        }

        return -1;

    }

}
